import type { Meta, StoryObj } from "@storybook/react";
import React from "react";
import AccountsPayableSettlementBarChart from "./index";
import { faker } from "@faker-js/faker";

const meta = {
  title: "柱状图/应收款应付款结算总体情况柱状图",
  component: AccountsPayableSettlementBarChart,
  tags: ["autodocs"],
  argTypes: {},
  decorators: [
    (Story) => (
      <div style={{ backgroundColor: "#06112B" }}>
        <Story />
      </div>
    ),
  ],
} satisfies Meta<typeof AccountsPayableSettlementBarChart>;

export default meta;
type Story = StoryObj<typeof meta>;

export const basic: Story = {
  args: {
    unitName: "万元",
    dataSource: faker.helpers.multiple(
      () => ({
        name: faker.date.month(),
        receivableAmount: faker.number.int({
          min: 1098,
          max: 5200,
        }),
        payableAmount: faker.number.int({
          min: 998,
          max: 4200,
        }),
      }),
      {
        count: 12,
      }
    ),
  },
};
